﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FacultyImplementation
{
    class Student
    {
        public string firstName;
        public string lastName;
        public DateTime birthDay;
        public int[] marks = new int[5];

        public void AddStudentsInfo()
        {
            Console.Write("Enter first name: ");
            firstName = Console.ReadLine();
            Console.Write("Enter last name: ");
            lastName = Console.ReadLine();
            Console.Write("Enter birth day (MM.DD.YYYY): ");
            birthDay = DateTime.Parse(Console.ReadLine());
        }

        public void AddStudentsMarks()
        {
            for (int i = 0; i < marks.Length; i++)
            {
                Console.Write("Enter mark: ");
                marks[i] = Int32.Parse(Console.ReadLine());
            }
        }

        public double CalculateAverageMark()
        {
            int sum = 0;
            for (int i = 0; i < marks.Length; i++)
            {
                sum += marks[i];
            }
            double averageMark = (double) sum / marks.Length;
            return averageMark;
        }

        public void StudentShowInfo()
        {
            Console.WriteLine();
            Console.WriteLine("Student: {0} {1}", firstName, lastName);
            Console.WriteLine("Birthday: {0}", birthDay.ToString("dd-MMMM-yyyy"));
            Console.WriteLine("Average mark: {0}", CalculateAverageMark());
        }
    }
}
